{% extends "base.html" %}
{% load humanize %}
{% block title %}Gallery index{% endblock %}
{% block css %}photos.css{% endblock %}
{% block content %}
	{% if gallery_list|length_is:"0" %}
		<div class="empty_gallery_notice">
			This gallery is empty. Come back later for some photos.
		</div>
	{% else %}
		<ul class="gallery_list">
		{% for gallery in gallery_list %}
			<li class="gallery">
				<div class="title">
					<a href="{{ gallery.get_absolute_url }}">{{ gallery.title }}</a>
					<span>
						{% if gallery.photos.all|length_is:"1" %}
							({{ gallery.photos.all|length|apnumber }} photo)
						{% else %}
							({{ gallery.photos.all|length|apnumber }} photos)
						{% endif %}
					</span>
				</div>
				<div class="featured_photos">
					{% for photo in gallery.featured_photos %}
						<a href="{{ photo.get_absolute_url }}">
							<img alt="{{ photo.title }}" src="{{ MEDIA_URL }}{{ photo.thumbnail_image }}" />
						</a>
					{% endfor %}
				</div>
			</li>
		{% endfor %}
	{% endif %}
{% endblock %}